package cn.edu.cqytxy.controller;

import cn.edu.cqytxy.entity.Aircraft;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author yinjw
 */
public class HomeServlet extends HttpServlet {

    @Override
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        Aircraft aircraft = new Aircraft();
        aircraft.setName("F-16");
        aircraft.setNum(10);
        req.setAttribute("username", "root");
        req.setAttribute("aircraft", aircraft);
        req.getRequestDispatcher("home.jsp").forward(req, resp);
    }
}
